import { GET_ALLBLOG, GET_BLOGTYPE, GET_CURRENTBLOG, GET_OTHERBLOGGER } from './actioncreater'

const defaultstore = {
    blog: [],
    currentblog: [],
    blogtype: [],
    otherblogger: []
}
export default function reducer(prestore = defaultstore, action) {
    const { type, data } = action;
    switch (type) {
        case GET_ALLBLOG: return { ...prestore, blog: data }
        case GET_BLOGTYPE: return { ...prestore, blogtype: data }
        case GET_CURRENTBLOG: return { ...prestore, currentblog: data }
        case GET_OTHERBLOGGER: return { ...prestore, otherblogger: data }
        default: return prestore;
    }
}


